package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 * @author hua
 * @since 2024-12-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_stock_check_product")
@NoArgsConstructor
public class StockCheckProductDo extends Model<StockCheckProductDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("check_id")
    private Long checkId;

    @TableField("product_id")
    private Long productId;
    @TableField("sku")
    private String sku;

    @TableField("main_type")
    private Integer mainType;


    @TableField("rack_id")
    private Long rackId;

    @TableField("company_id")
    private Long companyId;

    /**
     * 账面库存
     */
    @TableField("book_stock")
    private Integer bookStock;

    /**
     * 实盘库存
     */
    @TableField("solid_stock")
    private Integer solidStock;

    @TableField("child_tips")
    private String childTips;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

//    public StockCheckProductDo(Long productId, Long rackId, Long companyId, String childTips) {
//        this.productId = productId;
//        this.rackId = rackId;
//        this.companyId = companyId;
//        this.childTips = childTips;
//    }

    public StockCheckProductDo(Long productId, String sku, Integer mainType, Long rackId, Long companyId, String childTips) {
        this.productId = productId;
        this.sku = sku;
        this.mainType = mainType;
        this.rackId = rackId;
        this.companyId = companyId;
        this.childTips = childTips;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
